﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace SuperQuery
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        /// <summary>
        /// Event raised when the application starts up
        /// </summary>
        /// <param name="sender">Who raised the event</param>
        /// <param name="e">Details about the evet</param>
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            // Start the view factory
            if (!Views.ViewManager.StartFactory(new WPFViewFactory()))
            {
                MessageBox.Show("Failed to inistalise and start WPFViewFactory. Application cannot continue", "Unexpected Error");

                // View factory could ot be started so shut the application down and return 100
                Application.Current.Shutdown(100);
            }
        }
    }
}
